""""""

"""列表推导
"""
# 单for循环
lst = [x*x for x in range(10)]
print(lst) # [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

# 多个for循环
lst = [(x,y) for x in range(3) for y in range(3)]
# [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]
print(lst)

# 添加判断条件
lst = [(x,y) for x in range(3) for y in range(3) if x==y]
# [(0, 0), (1, 1), (2, 2)]
print(lst)